/*
 *  Copyright (C) 2010 Martin Haulrich <mwh.isv@cbs.dk> and Matthias Buch-Kromann <mbk.isv@cbs.dk>
 *
 *  This file is part of the IncrementalParser package.
 *
 *  The IncrementalParser program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General License for more details.
 *
 *  You should have received a copy of the GNU Lesser General License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.osdtsystem.incparser.features;

import java.io.Serializable;

/**
 *
 * @author Martin Haulrich and Matthias Buch-Kromann
 */
public interface FeatureVector extends Cloneable, Serializable {
    int features();
    float weight(int feature);
    void setWeight(int feature, float weight);
    void addWeight(int feature, float weight);
    void addTo(float scaleThis, FeatureVector other);
    void addTo(FeatureAggregator aggregator);

    double innerProduct(FeatureVector other);

    FeatureVector add(FeatureVector other);
    FeatureVector subtract(FeatureVector other);
    FeatureVector multiply(float scale);
    FeatureVector linearCombination(float scaleThis, float scaleOther, FeatureVector other);
    void toSet();

    void clear();
    void trimToSize();
    FeatureVector clone();
    void writeToFile(String filename);
}
